$(function () {
  layui.use('laydate', function(){
    var laydate = layui.laydate;
    
    laydate.render({
      elem: '#startTime'
    })

    laydate.render({
      elem: '#endTime'
    })
  })

  layui.use("layer",function(){
    
  })

  $('.add-diathesis .qplanpaper .add').on('click', function() {
    layui.use("layer",function(){
      layer.open({
        type: 1,
        title: '选择试卷',
        content: $('#select-test'),
        offset: '30px',
        area: ['700px', '600px']
      })
    })

    renderTestTable()
  })

  function renderTestTable() {
    layui.use('table', function () {
      var table = layui.table
      table.render({
        elem: '#test-table',
        url: '/Do/MS/queryMsBatchFileJson?' + $("#positionSearchbox").serialize(), //数据接口
        page: true,
        cols: [
          [
            { type:'checkbox', fixed:'left', width: 50 },
            { field: 'knowledgeName', title: '试卷名称', width: 400 },
            { field: 'knowledgeName', title: '素质特征', width: 105 },
            { field: 'knowledgeName', title: '胜任特征', width: 405 },
          ],
        ],
      })
    })
  }
})
